package com.zhong.wechat.enums;

/**
 * 微信消息类型enum
 */
public enum WeChatMessageTypeEnum {

    SUBSCRIBE("event.subscribe","用户关注事件"),
    UNSUBSCRIBE("event.unsubscribe","用户取消关注事件"),
    TEXT_MSG("text","接收用户文本消息");
    public String msgType;
    public String desc;

    WeChatMessageTypeEnum(String msgType, String desc) {
        this.msgType = msgType;
        this.desc = desc;
    }

    public static WeChatMessageTypeEnum getByMsgType(String msgType){
        for (WeChatMessageTypeEnum weChatMessageTypeEnum : WeChatMessageTypeEnum.values()) {
            if (weChatMessageTypeEnum.msgType.equals(msgType)) {
                return weChatMessageTypeEnum;
            }
        }
        return null;
    }

}
